package com.sdr.hkcamera;

import android.content.Intent;

import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaPlugin;
import org.json.JSONArray;
import org.json.JSONException;

/**
 * Created by homelajiang on 2016/9/23 0023.
 */

public class HKCameraManager extends CordovaPlugin {
    @Override
    public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
        if (action.equals("start")) {
            Intent intent = new Intent(cordova.getActivity(), HKMainActivity.class);
            intent.putExtra("url", args.getString(0));
            intent.putExtra("username", args.getString(1));
            intent.putExtra("password", args.getString(2));
            cordova.getActivity().startActivity(intent);
            return true;
        }
        return super.execute(action, args, callbackContext);
    }
}
